package org.lanqiao.tjut.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.lanqiao.tjut.bean.TeaBean;
import org.lanqiao.tjut.db.DBFactory;

/**
 * 登录信息
 * @author Kui
 *@return 返回查询结果集
 */
public class UserLoginModel {
	public List<TeaBean> getUserLoginInfo(TeaBean adminB){
		//sql语句查询老师的账号和密码
		String strSql = "select * from tea where t_number=? and t_password=?";
		//查询语句的sql语句
		List<Object> lstParas = new ArrayList<>();
		//添加参数
		lstParas.add(adminB.getT_number());
		lstParas.add(adminB.getT_password());
		//调用db层执行sql语句
		List<TeaBean> lstTea = DBFactory.getDBDriverInstance().query(strSql,
						new BeanListHandler<>(TeaBean.class),lstParas.toArray());
		//返回登录查询的结果信息集
	    return lstTea;
	}

}
